package com.anjubao.parking.municipal.user.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

/**
 * @author zhuchunfeng
 * @date 2019/7/22 17:31
 */
@Slf4j
@Getter
@Setter
@Accessors(chain = true)
@ApiModel("用户查询条件")
public class UserQueryForm {

    @ApiModelProperty("手机号")
    private String phone;
    @ApiModelProperty("车牌号")
    private String vehicle;
    @ApiModelProperty("用户名")
    private String name;
    @ApiModelProperty("默认1")
    private Integer page = 1;
    @ApiModelProperty("默认10")
    private Integer pageSize = 10;

    public void validate(){
        phone = StringUtils.trimToNull(phone);
        vehicle = StringUtils.trimToNull(vehicle);
        name = StringUtils.trimToNull(name);
    }
}
